import request from '@/utils/request'

/**
 * 获取维修人员类型列表（报修管理）
 * @return Promise
 */
export const screenRepairerTypeListAPI = () => {
  return request({
    url: '/repairer_type/screen'
  })
}

/**
 * 获取维修人员类型接口
 * @param {Object} data: {account, password}
 * @return Promise
 */
export const getRepairerTypeInfoAPI = (id) => {
  return request({
    url: `/common/repairer_type/${id}`
  })
}

/**
 * 获取维修人员类型列表
 * @param {Object} data: { page: 页码, pagesize: 每页条数 }
 * @return Promise
 */
export const getRepairerTypeListAPI = (params) => {
  return request({
    url: '/repairer_type/',
    params
  })
}

/**
 * 根据name模糊查询维修人员类型
 * @param {Object} data: { page: 页码, pagesize: 每页条数, name:类型名称 }
 * @return Promise
 */
export const queryRepairerTypeAPI = (params) => {
  return request({
    url: '/repairer_type/query',
    params
  })
}

/**
 * 添加维修人员类型
 * @param {Object} data: { name: 名称, description: 描述 }
 * @return Promise
 */
export const addRepairerTypeAPI = (data) => {
  return request({
    url: '/repairer_type/',
    method: 'POST',
    data
  })
}

/**
 * 修改维修人员类型信息
 * @param {Object} data: { name: 名称, description: 描述 }
 * @return Promise
 */
export const updateRepairerTypeAPI = (data) => {
  return request({
    url: '/repairer_type/',
    method: 'PATCH',
    data
  })
}

/**
 * 删除维修人员类型
 * @param id
 * @return Promise
 */
export const deleteRepairerTypeAPI = (id) => {
  return request({
    url: `/repairer_type/${id}`,
    method: 'DELETE'
  })
}
